<template>
	<view>
		<cu-custom bgColor="bg-gradual-blue" :isBack="true" class="nav-custom">
			<!-- <block slot="backText">返回</block> -->
			<block slot="content">个人设置</block>
		</cu-custom>
		<view class="app-box" :style="{ height: appHeight + 'px' }">
			<u-cell-group>
				<u-cell-item title="昵称" :value="userInfo.nickName" @click="go"></u-cell-item>
				<u-cell-item title="归属机构" :value="userInfo.deptName" :arrow="false"></u-cell-item>
				<u-cell-item title="手机号码" :value="userInfo.phone" @click="go"></u-cell-item>
				<u-cell-item title="邮箱" :value="userInfo.email" @click="go"></u-cell-item>
				<u-cell-item title="账号" :value="userInfo.userName" :arrow="false"></u-cell-item>
				<u-cell-item title="密码" value="" @click="goPass"></u-cell-item>
				<u-cell-item title="性别" :value="userInfo.sex | sexStr" @click="go"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>
<script>
	export default {
		name: 'personSetting',
		components: {},
		data() {
			return {
				appHeight: 0,

				userInfo: {}
			}
		},
		computed: {},
		onShow() {
			this.initPage()
		},
		async mounted() {
			this.appHeight = await this.$getHeight('.nav-custom')
			this.initPage()
		},
		filters: {
			sexStr: function (value) {
				if (value == 0) {
					return '男'
				} else {
					return '女'
				}
			}
		},
		methods: {
			initPage() {
				const getUserInfoData = uni.getStorageSync('getUserInfoData')
				this.userInfo = getUserInfoData
			},
			go() {
				this.$toUrl('/pages/user/person/modifySelf', { id: this.userInfo.id })
			},
			goPass() {
				this.$toUrl('/pages/user/person/modifySelfPass', { id: this.userInfo.id })
			}
		}
	}
</script>
<style lang="less"></style>
